The present disclosure relates to controller area networks, and more specifically, to controller area network nodes synchronization.
A controller area network (CAN) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other. CAN networks include a message-based protocol that was originally designed for multiplex electrical wiring in road vehicles. Due to its real time and data collision avoidance properties, CAN has been widely used in the other industries including aerospace.
Typically, in nodes on a CAN bus (for example, the CAN discussed below with respect to FIG. 1), the periodic CAN application tasks running on microcontrollers have the same task cycle time by design, and each CAN node may transmit a group of messages (message burst) on the CAN bus and receive messages from the other nodes once every CAN task cycle. The periodic CAN messages are produced and consumed by the periodic CAN application tasks. However, since the CAN protocol does not provide accurate global time service and each node has its own clock, the CAN task cycles on the CAN nodes are not synchronized to each other, which makes the CAN task cycles with the message pack/unpack procedures in the CAN nodes and consequently message bursts on CAN bus drift away from each other over time.
This can cause overwritten messages and absent messages. The overwritten message occurs when two messages (with the same message identifier but possibly different settings for the same set of parameters inside), transmitted once in each of two consecutive CAN task cycles from a node, are received in one CAN task cycle on a receiving node. This phenomenon can result in a lost message on the receiving node, where either the older or the newer message gets dropped depending on the CAN application interface setup. The absent message occurs when a message, transmitted once every CAN task cycle from a transmission node, is supposed to be but is not received in a CAN task cycle on a receiving node, which can result in stale data from the previously received message being used by the applications. The jitters from different procedures executing on the microcontroller in the CAN node can worsen the effects of overwritten and absent message. CAN bus contention, where multiple CAN nodes attempt to transmit on the CAN bus at the same time and one or more CAN nodes are required to wait until the bus is free, can also worsen this effect. Lost and/or absent messages may not be tolerable in mission critical applications.